package com.scen.sys.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public class WebUtils {

	/**
	 * 得到request
	 * @return
	 */
	public static HttpServletRequest getRequest() {
		ServletRequestAttributes requestAttributes=(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
		HttpServletRequest request=requestAttributes.getRequest();
		return request;
	}
	/**
	 * @return 得到Session
	 */
	public static HttpSession getSession() {
		return getRequest().getSession();
	}
	
}
